<?php if(!empty($subvo)){
    $v = $subvo;
    $subvo = '';
}
if(!empty($subsubvo)){
    $v = $subsubvo;
    $subsubvo = '';
}
?>
<div class="viewBox myBox<?php echo $v['id'];?>"<?php if($_SESSION[C('USER_AUTH_KEY')]){?> sortID="<?php echo $v['sort'];?>" modulesID="<?php echo $v['id'];?>" title="<?php echo $v['title'];?>" deleteUrl="<?php echo U('/Admin/Modules/delete',array('id'=>$v['id']));?>" settingUrl="<?php echo U('/Admin/Modules/edit',array('id'=>$v['id']));?>" editUrl="<?php echo U('/Admin/Window/index',array('modules_id' => $v['id'], 'siteid' => __SITEID__, 'tablename'=>'Nav','fieldlist' => 'title,link,target,sort,icon,img_url','map'=>'modules_id,'.$v['id']));?>" isEdit="1"<?php }?>>
  <?php if(!empty($v['dataname'])){
                $v['content'] = $v['dataname'];
                
        }else{
            $v['content'] = unserialize($v['content']);
        }
         ?>
 
  <nav class="navbar navbar-fixed-<?php if($v['position'] == 'top' or $v['position'] == 'bottom'){echo $v['position'];}?>" role="navigation">
    <div class="navbar-header">
      <button type="button" class="glyphicon glyphicon-th-list navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-<?php echo $v['id'];?>"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-<?php echo $v['id'];?>">
      <ul class="nav navbar-nav">
        <?php $dataList = getNavData($v['id']);foreach($dataList as $key => $n){?>
        <?php if(getModulesMultiNavTree($n['id'],'sub') == ''){?>
        <li class="<?php if(count($dataList) == $key + 1){echo 'last';}?><?php if($key == 0){echo 'first';}?>"> <a href="<?php echo $n['link'];?>" <?php if($n['target'] == 1){?>target="_blank"<?php }?>><?php if($n['icon'] != ''){?><i class="<?php echo $n['icon'];?>" aria-hidden="true"></i>&nbsp;<?php }?><?php echo $n['title'];?></a> </li>
        <?php }else{?>
        <li class="dropdown <?php if(count($dataList) == $key + 1){echo 'last';}?><?php if($key == 0){echo 'first';}?>"> <a href="<?php echo $n['link'];?>" class="dropdown-toggle dropdown<?php echo $v['id'];?>" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php if($n['icon'] != ''){?><i class="<?php echo $n['icon'];?>" aria-hidden="true"></i>&nbsp;<?php }?><?php echo $n['title'];?></a> <?php echo getModulesMultiNavTree($n['id'],'dropdown-menu'); ?> </li>
        <?php }?>
        <?php }?>
      </ul>
      <?php if($v['displayForm']>0){?>
      <form class="navbar-form navbar-right" method="get" action="" role="search">
        <div class="form-group">
          <input type="text" name="keywords" class="form-control" placeholder="输入关键词">
        </div>
        <button type="submit" class="btn btn-info">搜索</button>
      </form>
      <?php }?>
    </div>
  </nav>
  <script>
	$(".dropdown<?php echo $v['id'];?>").on("mouseover", function() {
        $(this).dropdown("toggle")
    });
	$(".dropdown<?php echo $v['id'];?>").parent().on("mouseleave", function() {
        $(this).dropdown("toggle")
    });
	</script> 
</div>
